//
// Pinhole.cpp for  in /home/herpec_j/Dropbox/Projets/raytracer-2016/Sources/Cameras/
//
// Made by Jonathan
// Login   <ledey_l@epitech.net>
//
// Started on  Tue Sep 24 10:17:05 2013 Jonathan
// Last update Thu Sep 26 00:35:19 2013 Jonathan
//

#include		"Cameras/Pinhole.hpp"

namespace		Cameras
{
  Pinhole::Pinhole(void) : Camera(), mViewDistance(500), mZoom(1)
  {
    return;
  }

  Pinhole::Pinhole(Pinhole const &rOther) : Camera(rOther), mViewDistance(rOther.mViewDistance), mZoom(rOther.mZoom)
  {
    return;
  }

  Pinhole		&Pinhole::operator=(Pinhole const &rOther)
  {
    if (this != &rOther)
      {
	Camera::operator=(rOther);
	mViewDistance = rOther.mViewDistance;
	mZoom = rOther.mZoom;
      }
    return (*this);
  }

  Pinhole		*Pinhole::Clone(void) const
  {
    return (new Pinhole(*this));
  }

  void			Pinhole::SetViewDistance(long double rViewDistance)
  {
    mViewDistance = rViewDistance;
  }

  void			Pinhole::SetZoom(long double rZoom)
  {
    mZoom = rZoom;
  }

  Maths::Vector		Pinhole::GetDirection(Maths::Point const &rPoint) const
  {
    Maths::Vector	direction = rPoint[0] * mU + rPoint[1] * mV - mViewDistance * mW;

    direction.Normalize();
    return (direction);
  }

  void			Pinhole::RenderScene(void)
  {
    return;
  }

  Pinhole::~Pinhole(void)
  {
    return;
  }
};
